package ec.fugu.samples;

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;

public class PleaseWaitDemoScreen extends MainScreen {

    PleaseWaitPopupScreen _waitScreen = null;
    LabelField _resultField = new LabelField("Result in here");

    public PleaseWaitDemoScreen() {
        this.setTitle("PleaseWaitDemo");
        ButtonField startButton = new ButtonField("Start", ButtonField.FIELD_HCENTER | ButtonField.CONSUME_CLICK);
        startButton.setChangeListener( new FieldChangeListener() {
            public void fieldChanged(Field field, int context) {
                _waitScreen = new PleaseWaitPopupScreen("Please wait", "Wating for test Thread", "dummy URL, not actually used");
                int result = _waitScreen.show();
                _resultField.setText("Result: " + Integer.toString(result));
            }
        });
        this.add(startButton);
        this.add(_resultField);
    }

}
